const checkValue = (v, b) => (v && b) ? b(v) : false;

checkValue(pm.response.headers.get('x-sessionid'), v => {
    pm.environment.set("virens-sessionid", v);
});